/**
 * 
 */
package officeserver.users;

import java.io.Serializable;

/**
 * This class is a data container for an address. It groups all of the address
 * information together into a single address object that has methods to return
 * specific address elements, or a standard 2 line string output of the address.
 * 
 * @author mramsey3
 * 
 */
public class Address implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    private int streetNumber;

    private int zipCode;

    private String road;

    private String state;

    /**
     * The default constructor for creating a blank address. It passes
     * placeholder info into the primary constructor.
     */
    public Address() {
	//this(000, "unknown", 000, "unknown");
    }

    /**
     * This constructor is the primary constructor used, storing all of the
     * parameters into the correct locations.
     * 
     * @param streetNumber
     *            The house street number to store
     * @param road
     *            The road to store
     * @param zipCode
     *            The zipcode to store
     * @param state
     *            The state to store
     */
    public Address(int streetNumber, String road, int zipCode, String state) {

	this.streetNumber = streetNumber;
	this.road = road;
	this.zipCode = zipCode;
	this.state = state;

    }

    /**
     * This method returns the address information formatted in a "mailing"
     * address, 2 line block form.
     * 
     * @author mramsey3
     * @return String The address in a 2 line block formation.
     */
    public String getAddress() {
	return ("" + streetNumber + " " + road + "\n" + zipCode + ", " + state);
    }

    /**
     * Setter for the street number part of an address.
     * 
     * @author mramsey3
     * @param streetNumber
     *            The street number to store.
     */
    public void setStreetNumber(int streetNumber) {
	this.streetNumber = streetNumber;
    }

    /**
     * Setter for the zip code of an address.
     * 
     * @author mramsey3
     * @param zipCode
     *            the zipcode to store.
     */
    public void setZipCode(int zipCode) {
	this.zipCode = zipCode;
    }

    /**
     * Setter for the road part of an address.
     * 
     * @author mramsey3
     * @param road
     *            the road to set.
     */
    public void setRoad(String road) {
	this.road = road;
    }

    /**
     * Setter for the state part of an address.
     * 
     * @author mramsey3
     * @param state
     *            the state to store.
     */
    public void setState(String state) {
	this.state = state;
    }

    /*
     * (non-Javadoc)
     * 
     * @see java.lang.Object#clone()
     * 
     * @author Chris Bayruns
     */
    public Address clone() {
	Address result = new Address();
	result.setRoad(new String(road));
	result.setState(new String(state));
	result.setStreetNumber(streetNumber); // TODO: may have a problem here
	result.setZipCode(zipCode); // with apartments that have

	return result;
    }
}
